/*
 * gc_test_userProvideSize.c
 *
 *  Created on: Dec 9, 2011
 *      Author: Rui Zhuang
 */

#include "../src/gc.h"

int main(int argc, char** argv){
	int userSize = 0;
	if(argc == 2){
		char* size = argv[1];
        userSize = atoi(size);
	}
	if(userSize > 0){
		printf("User provided size : %d\n",userSize);
		gc_init_max_heap_size(userSize);
	}

	int* a;
	gc_add_root_node(&a);
	int* b;
	gc_add_root_node(&b);
	a = (int*)gc_malloc(sizeof(int)*3);
	*(a+0) = 1;
	*(a+1) = 2;
	*(a+2) = 3;
	b = (int*)gc_malloc(sizeof(int)*(3));
	gc_free_root_node(&a);
	gc_free_root_node(&b);
	gc_recycle();
	printf("Successfully run gc_test_userProvideSize1!\n");
	return 0;
}
